import sys

import yaml


class ConfigUtil:


    @staticmethod
    def get_api_key():
        base_path = sys.path[0]

        config_path = f'{base_path[:base_path.index('insight_agent')]}/insight_agent/agent_rule_new_customer_lijia/conf/config.yaml'

        with open(config_path, 'r') as f:
            config = yaml.safe_load(f)

        # 读取配置项
        return config['llm']['api_key']

    @staticmethod
    def get_neo4j():
        base_path = sys.path[0]

        config_path = f'{base_path[:base_path.index('insight_agent')]}/insight_agent/agent_rule_new_customer_lijia/conf/config.yaml'

        with open(config_path, 'r') as f:
            config = yaml.safe_load(f)

        # 读取配置项
        return [config['neo4j']['url'],config['neo4j']['user'],config['neo4j']['pass']]